all : sysm

CC = gcc
CGI_LIB = cgihtml/cgihtml.a
CGI_HEAD = cgi-lib.h cgi-llist.h html-lib.h string-lib.h
CFLAGS = -Wall -g -ansi
INC_PATH = cgihtml
LIB_PATH = cgihtml

sysm : index.cgi main.cgi readonly.cgi

.c.o :
	$(CC) $(CFLAGS) -I$(INC_PATH) -c $<

index.cgi.o : index.cgi.c
main.cgi.o : main.cgi.c common.h
readonly.o : readonly.cgi.c common.h
common.o : common.c common.h
sysman.o : sysman.c sysman.h

index.cgi : index.cgi.o common.o $(CGI_LIB)
	$(CC) -o $@ index.cgi.o common.o $(CGI_LIB)

main.cgi : main.cgi.o common.o $(CGI_LIB)
	$(CC) -o $@ main.cgi.o common.o $(CGI_LIB)

readonly.cgi : readonly.cgi.o common.o $(CGI_LIB)
	$(CC) -o $@ readonly.cgi.o common.o $(CGI_LIB)

clean :
	rm *.o -rf
	rm *.cgi -rf

